package com.moyuaninfo.myyserver.enums;

import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModelProperty;

/**
 * 云台控制命令

 * @author QiuXiangBa
 * @date 2020/3/12
 **/
public enum DwPTZCommandEnum {

    /** 宏定义*/
    TILT_UP(21, "云台上仰"),

    TILT_DOWN(22, "云台下俯"),

    PAN_LEFT(23, "云台左转"),

    PAN_RIGHT(24, "云台右转"),

    UP_LEFT(25, "云台上仰"),

    UP_RIGHT(26, "云台上仰"),

    DOWN_LEFT(27, "云台上仰"),

    DOWN_RIGHT(28, "云台上仰"),

    ZOOM_IN(11, "焦距变大(倍率变大)"),

    ZOOM_OUT(12, "焦距变小(倍率变小)"),

    ;
    DwPTZCommandEnum(int value, String describe) {
        this.value = value;
        this.describe = describe;
    }

    /** 宏定义值*/
    private int value;

    /** 含义*/
    private String describe;


    public int getValue() {
        return value;
    }

    public String getDescribe() {
        return describe;
    }

    /**
     * 根据枚举名获取宏定义值
     *
     * @param name 枚举名
     * @return int 宏定义值
     *
     * @author QiuXiangBa
     * @date 2020/3/12
     **/
    public static int getValueByName(String name) {
        DwPTZCommandEnum dwPtzCommandEnum = DwPTZCommandEnum.valueOf(name);
        return dwPtzCommandEnum.getValue();
    }

    @Override
    public String toString() {
        return String.valueOf(this.name()+ "-" + describe);
    }
}
